//
//  Users.m
//  QuickCure1
//
//  Created by maoge on 16/10/30.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "Users.h"

@implementation Users


+ (instancetype)userWithDic:(NSDictionary *)dic{
    Users *user = [[Users alloc] init];
    
    user.true_name = dic[@"true_name"];
    
    return user;
}

- (NSString *)description
{
    return [self yy_modelDescription];
}


//归档是一个过程 告诉系统 ,该对象的哪些属性需要存储
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.true_name forKey:@"true_name"];
    [aCoder encodeObject:self.weight forKey:@"weight"];
    [aCoder encodeObject:self.height forKey:@"height"];
    [aCoder encodeObject:self.head_photo forKey:@"head_photo"];
    [aCoder encodeObject:self.age forKey:@"age"];
    [aCoder encodeObject:self.mobile_number forKey:@"mobile_number"];
    [aCoder encodeObject:self.user_id forKey:@"user_id"];
    [aCoder encodeBool:self.gender forKey:@"gender"];
    [aCoder encodeObject:self.address forKey:@"address"];
    
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super init]) {
        self.true_name = [aDecoder decodeObjectForKey:@"true_name"];
        self.weight = [aDecoder decodeObjectForKey:@"weight"];
        self.height = [aDecoder decodeObjectForKey:@"height"];
        self.head_photo = [aDecoder decodeObjectForKey:@"head_photo"];
        self.age = [aDecoder decodeObjectForKey:@"age"];
        self.mobile_number = [aDecoder decodeObjectForKey:@"mobile_number"];
        self.user_id = [aDecoder decodeObjectForKey:@"user_id"];
        self.gender = [aDecoder decodeBoolForKey:@"gender"];
        self.address = [aDecoder decodeObjectForKey:@"address"];
    }
    return self;
}


@end
